[#ftl]
[#list configs as dt]
[#assign data = dt]
[#assign peripheralParams = dt.peripheralParams]
[#assign peripheralGPIOParams = dt.peripheralGPIOParams]
[#assign peripheralDMAParams = dt.peripheralDMAParams]
[#assign peripheralNVICParams = dt.peripheralNVICParams]
[#assign usedIPs = dt.usedIPs]
[#assign adc=false can=false dma=false gpio=false fmpi2c=false i2c=false i2s=false sai=false sdio=false spi=false tim=false lptim=false]
[#assign uart=false usart=false irda=false smartcard=false pcd=false hcd=false]
[#assign nor=false nand=false pccard=false sram=false sdram=false dac=false]
[#assign adc_ll=false dma_ll=false gpio_ll=false i2c_ll=false spi_ll=false sdio_ll=false tim_ll=false]
[#assign lptim_ll=false usart_ll=false usb_ll=false dac_ll=false fsmc_ll=false fmc_ll=false]
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- ******************************************************************************
 * File Name   : FrameworkCubeMX.gpdsc
 * Date        : ${date}
 * Description : Generator PDSC File generated by STM32CubeMX (DO NOT EDIT!)
 ****************************************************************************** -->

<package xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" schemaVersion="1.0" xs:noNamespaceSchemaLocation="PACK.xsd">
  <vendor>Keil</vendor>
  <name>FrameworkCubeMX</name>
  <description>STM32CubeMX generated pack description</description>
  <url>project-path</url>
  <releases>
    <release version="1.0.0">
     - Generated: ${date}
    </release>
  </releases>
  <generators>
    <generator id="STM32CubeMX" Gvendor="STMicroelectronics" Gtool="STM32CubeMX" Gversion="4.10.0">
      <description>STM32CubeMX Environment</description>
      <select Dname="${(dt.device)}" Dvendor="STMicroelectronics:13"/>
      <command>$SMDK\CubeMX\STM32CubeMXLauncher</command>
      <workingDir>$PRTE\Device\${(dt.device)}</workingDir>
      <project_files>
        <file category="include" name="STCubeGenerated/Inc/"/>
        <file category="include" name="Drivers/STM32H7xx_HAL_Driver/Inc/"/>
        <file category="source" name="STCubeGenerated/Src/main.c" />
        <file category="header" name="STCubeGenerated/Inc/stm32f4xx_it.h"/>
        <file category="source" name="STCubeGenerated/Src/stm32f4xx_it.c"/>
      </project_files>
    </generator>
  </generators>
  <taxonomy>
    <description Cclass="Device" Cgroup="STM32Cube Framework" generator="STM32CubeMX">STM32Cube Framework</description>
  </taxonomy>
  <conditions>
    <condition id="STCubeMX">
      <description>Condition to include CMSIS core and Device Startup components</description>
      <require Dvendor="STMicroelectronics:13" Dname="STM32F4*"/>
      <require Cclass="CMSIS"  Cgroup="CORE"          Csub=""/>
      <require Cclass="Device" Cgroup="Startup"/>
      [#if peripheralParams.get("RCC")??]
      [#if peripheralParams.get("RCC").get("driver") == ("HAL")]
      <require Cclass="Device" Cgroup="STM32Cube HAL" Csub="Common"/>
      [#else]
      <require Cclass="Device" Cgroup="STM32Cube LL" Csub="Common"/>
      [/#if]
      [/#if]
[#list usedIPs as ip]
[#if peripheralDMAParams.get(ip)?? && peripheralDMAParams.get(ip).entrySet()?size > 0]
  [#if peripheralParams.get(ip).get("driver") == ("HAL")]
    [#if !dma]
      <require Cclass="Device" Cgroup="STM32Cube HAL" Csub="DMA"/>
      [#assign dma=true]
    [/#if]        
  [#elseif !dma_ll]
      <require Cclass="Device" Cgroup="STM32Cube LL"  Csub="DMA"/>
      [#assign dma_ll=true]
  [/#if]
[/#if]
[#if peripheralGPIOParams.get(ip)?? && peripheralGPIOParams.get(ip).entrySet()?size > 0]
  [#if peripheralParams.get(ip).get("driver") == ("HAL")]
    [#if !gpio]
      <require Cclass="Device" Cgroup="STM32Cube HAL" Csub="GPIO"/>
      [#assign gpio=true]
    [/#if]        
  [#elseif !gpio_ll]
      <require Cclass="Device" Cgroup="STM32Cube LL"  Csub="GPIO"/>
      [#assign gpio_ll=true]
  [/#if]
[/#if]
[#if peripheralParams.get(ip)??]
[#if ip?starts_with("DMA2D")]
  [#if peripheralParams.get(ip).get("driver") == ("HAL")]
      <require Cclass="Device" Cgroup="STM32Cube HAL" Csub="DMA2D"/>
  [#else]
      <require Cclass="Device" Cgroup="STM32Cube LL"  Csub="DMA2D"/>
  [/#if]
[#elseif ip?starts_with("DMA")]
  [#if peripheralParams.get(ip).get("driver") == ("HAL")]
    [#if !dma]
      <require Cclass="Device" Cgroup="STM32Cube HAL" Csub="DMA"/>
      [#assign dma=true]
    [/#if]        
  [#elseif !dma_ll]
      <require Cclass="Device" Cgroup="STM32Cube LL"  Csub="DMA"/>
      [#assign dma_ll=true]
  [/#if]
[#elseif ip?starts_with("GPIO")]
  [#if peripheralParams.get(ip).get("driver") == ("HAL")]
    [#if !gpio]
      <require Cclass="Device" Cgroup="STM32Cube HAL" Csub="GPIO"/>
      [#assign gpio=true]
    [/#if]        
  [#elseif !gpio_ll]
      <require Cclass="Device" Cgroup="STM32Cube LL"  Csub="GPIO"/>
      [#assign gpio_ll=true]
  [/#if]
[#elseif ip?starts_with("ADC")]
  [#if peripheralParams.get(ip).get("driver") == ("HAL")]
    [#if !adc]
      <require Cclass="Device" Cgroup="STM32Cube HAL" Csub="ADC"/>
      [#assign adc=true]
    [/#if]
  [#elseif !adc_ll]
      <require Cclass="Device" Cgroup="STM32Cube LL"  Csub="ADC"/>
      [#assign adc_ll=true]
  [/#if]
[#elseif ip?starts_with("CAN")]
  [#if !can]
      <require Cclass="Device" Cgroup="STM32Cube HAL" Csub="CAN"/>
      [#assign can=true]
  [/#if]
[#elseif ip?starts_with("DAC")]
  [#if peripheralParams.get(ip).get("driver") == ("HAL")]
    [#if !dac]
      <require Cclass="Device" Cgroup="STM32Cube HAL" Csub="DAC"/>
      [#assign dac=true]
    [/#if]        
  [#elseif !dac_ll]
      <require Cclass="Device" Cgroup="STM32Cube LL"  Csub="DAC"/>
      [#assign dac_ll=true]        
  [/#if]
[#elseif ip == "DSIHOST"]
      <require Cclass="Device" Cgroup="STM32Cube HAL" Csub="DSI"/>
[#elseif ip?starts_with("FSMC")]
  [#if peripheralParams.get(ip).get("driver") == ("HAL")]
  [#list peripheralParams.get(ip).entrySet() as paramEntry]
  [#if paramEntry.key?starts_with("MemoryType")]
    [#if paramEntry.value?contains("NOR")]
      [#if !nor]
      <require Cclass="Device" Cgroup="STM32Cube HAL" Csub="NOR"/>
      [#assign nor=true]
      [/#if]
    [#elseif paramEntry.value?contains("SRAM")]
      [#if !sram]
      <require Cclass="Device" Cgroup="STM32Cube HAL" Csub="SRAM"/>
      [#assign sram=true]
      [/#if]
    [/#if]
  [#elseif paramEntry.key == "NAND_Instance"]
    [#if !nand]
      <require Cclass="Device" Cgroup="STM32Cube HAL" Csub="NAND"/>
      [#assign nand=true]
    [/#if]
  [#elseif paramEntry.key == "PCCARD_Instance"]
    [#if !pccard]
      <require Cclass="Device" Cgroup="STM32Cube HAL" Csub="PC Card"/>
      [#assign pccard=true]
    [/#if]
  [/#if]
  [/#list]
  [#elseif !fsmc_ll]
      <require Cclass="Device" Cgroup="STM32Cube LL"  Csub="FSMC"/>
      [#assign fsmc_ll=true]        
  [/#if] 
[#elseif ip?starts_with("FMC")]
  [#if peripheralParams.get(ip).get("driver") == ("HAL")]
  [#list peripheralParams.get(ip).entrySet() as paramEntry]
  [#if paramEntry.key?starts_with("MemoryType")]
    [#if paramEntry.value?contains("NOR")]
      [#if !nor]
      <require Cclass="Device" Cgroup="STM32Cube HAL" Csub="NOR"/>
      [#assign nor=true]
      [/#if]
    [#elseif paramEntry.value?contains("SRAM")]
      [#if !sram]
      <require Cclass="Device" Cgroup="STM32Cube HAL" Csub="SRAM"/>
      [#assign sram=true]
      [/#if]
    [/#if]
  [#elseif paramEntry.key == "NAND_Instance"]
    [#if !nand]
      <require Cclass="Device" Cgroup="STM32Cube HAL" Csub="NAND"/>
      [#assign nand=true]
    [/#if]
  [#elseif paramEntry.key == "PCCARD_Instance"]
    [#if !pccard]
      <require Cclass="Device" Cgroup="STM32Cube HAL" Csub="PC Card"/>
      [#assign pccard=true]
    [/#if]
  [#elseif paramEntry.key == "SDRAM_Instance"]
    [#if !sdram]
      <require Cclass="Device" Cgroup="STM32Cube HAL" Csub="SDRAM"/>
      [#assign sdram=true]
    [/#if]
  [/#if]
  [/#list]
  [#elseif !fmc_ll]
      <require Cclass="Device" Cgroup="STM32Cube LL"  Csub="FMC"/>
      [#assign fmc_ll=true]        
  [/#if]  
[#elseif ip?starts_with("FMPI2C")]
  [#if !fmpi2c]
      <require Cclass="Device" Cgroup="STM32Cube HAL" Csub="FMPI2C"/>
      [#assign fmpi2c=true]
  [/#if]
[#elseif ip == "HDMI_CEC"]
      <require Cclass="Device" Cgroup="STM32Cube HAL" Csub="CEC"/>
[#elseif ip?starts_with("I2C")]
  [#if peripheralParams.get(ip).get("driver") == ("HAL")]
    [#if !i2c]
      <require Cclass="Device" Cgroup="STM32Cube HAL" Csub="I2C"/>
      [#assign i2c=true]
    [/#if]        
  [#elseif !i2c_ll]
      <require Cclass="Device" Cgroup="STM32Cube LL"  Csub="I2C"/>
      [#assign i2c_ll=true]        
  [/#if]
[#elseif ip?starts_with("I2S")]
  [#if !i2s]
      <require Cclass="Device" Cgroup="STM32Cube HAL" Csub="I2S"/>
      [#assign i2s=true]
  [/#if]
[#elseif ip?starts_with("LPTIM")]
  [#if peripheralParams.get(ip).get("driver") == ("HAL")]
    [#if !lptim]
      <require Cclass="Device" Cgroup="STM32Cube HAL" Csub="LPTIM"/>
      [#assign lptim=true]
    [/#if]        
  [#elseif !lptim_ll]
      <require Cclass="Device" Cgroup="STM32Cube LL"  Csub="LPTIM"/>
      [#assign lptim_ll=true]        
  [/#if]
[#elseif ip == "NVIC"]
[#elseif ip == "QUADSPI"]
      <require Cclass="Device" Cgroup="STM32Cube HAL" Csub="QSPI"/>
[#elseif ip?starts_with("SAI")]
  [#if !sai]
      <require Cclass="Device" Cgroup="STM32Cube HAL" Csub="SAI"/>
      [#assign sai=true]
  [/#if]
[#elseif ip?starts_with("SDIO")]
  [#if peripheralParams.get(ip).get("driver") == ("HAL")]
    [#if !sdio]
      <require Cclass="Device" Cgroup="STM32Cube HAL" Csub="SD"/>
      [#assign sdio=true]
    [/#if]
  [#elseif !sdio_ll]
      <require Cclass="Device" Cgroup="STM32Cube LL"  Csub="SDMMC"/>
      [#assign sdio_ll=true]
  [/#if]
[#elseif ip?starts_with("SPI")]
  [#if peripheralParams.get(ip).get("driver") == ("HAL")]
    [#if !spi]
      <require Cclass="Device" Cgroup="STM32Cube HAL" Csub="SPI"/>
      [#assign spi=true]
    [/#if]        
  [#elseif !spi_ll]
      <require Cclass="Device" Cgroup="STM32Cube LL"  Csub="SPI"/>
      [#assign spi_ll=true]        
  [/#if]
[#elseif ip?starts_with("SYS")]
[#elseif ip?starts_with("TIM")]
  [#if peripheralParams.get(ip).get("driver") == ("HAL")]
    [#if !tim]
      <require Cclass="Device" Cgroup="STM32Cube HAL" Csub="TIM"/>
      [#assign tim=true]
    [/#if]        
  [#elseif !tim_ll]
      <require Cclass="Device" Cgroup="STM32Cube LL"  Csub="TIM"/>
      [#assign tim_ll=true]        
  [/#if]
[#elseif ip?starts_with("UART")]
  [#if peripheralParams.get(ip).get("driver") == ("HAL")]
  [#assign irda_pm=false]
  [#list peripheralParams.get(ip).entrySet() as paramEntry]
  [#if paramEntry.key?starts_with("IrDAMode")]
    [#if paramEntry.value?starts_with("IRDA")]
      [#assign irda_pm=true]
      [#if !irda]
      <require Cclass="Device" Cgroup="STM32Cube HAL" Csub="IRDA"/>
      [#assign irda=true]
      [/#if]
    [/#if]
  [/#if]
  [/#list]
  [#if irda_pm == false]
    [#if !uart]
      <require Cclass="Device" Cgroup="STM32Cube HAL" Csub="UART"/>
      [#assign uart=true]
    [/#if]
  [/#if]
  [#else]
    [#if !usart_ll]
      <require Cclass="Device" Cgroup="STM32Cube LL" Csub="USART"/>
      [#assign usart_ll=true]
    [/#if]
  [/#if]  
[#elseif ip?starts_with("USART")]
  [#if peripheralParams.get(ip).get("driver") == ("HAL")]
  [#list peripheralParams.get(ip).entrySet() as paramEntry]
  [#if paramEntry.key?starts_with("VirtualMode")]
    [#if paramEntry.value == "VM_IRDA"]
      [#if !irda]
      <require Cclass="Device" Cgroup="STM32Cube HAL" Csub="IRDA"/>
      [#assign irda=true]
      [/#if]
    [#elseif paramEntry.value == "VM_SMARTCARD"]
      [#if !smartcard]
      <require Cclass="Device" Cgroup="STM32Cube HAL" Csub="Smartcard"/>
      [#assign smartcard=true]
      [/#if]
    [#elseif paramEntry.value == "VM_SYNC"]
      [#if !usart]
      <require Cclass="Device" Cgroup="STM32Cube HAL" Csub="USART"/>
      [#assign usart=true]
      [/#if]
    [#else]
      [#if !uart]
      <require Cclass="Device" Cgroup="STM32Cube HAL" Csub="UART"/>
      [#assign uart=true]
      [/#if]
    [/#if]
  [/#if]
  [/#list]
  [#else]
    [#if !usart_ll]
      <require Cclass="Device" Cgroup="STM32Cube LL" Csub="USART"/>
      [#assign usart_ll=true]
    [/#if]
  [/#if]  
[#elseif ip?starts_with("USB")]
  [#if peripheralParams.get(ip).get("driver") == ("HAL")]
  [#list peripheralParams.get(ip).entrySet() as paramEntry]
  [#if paramEntry.key?starts_with("VirtualMode")]
    [#if paramEntry.value?starts_with("Device")]
      [#if !pcd]
      <require Cclass="Device" Cgroup="STM32Cube HAL" Csub="PCD"/>
      [#assign pcd=true]
      [/#if]
    [#elseif paramEntry.value?starts_with("Host")]
      [#if !hcd]
      <require Cclass="Device" Cgroup="STM32Cube HAL" Csub="HCD"/>
      [#assign hcd=true]
      [/#if]
    [#else]
      [#if !pcd]
      <require Cclass="Device" Cgroup="STM32Cube HAL" Csub="PCD"/>
      [#assign pcd=true]
      [/#if]
      [#if !hcd]
      <require Cclass="Device" Cgroup="STM32Cube HAL" Csub="HCD"/>
      [#assign hcd=true]
      [/#if]
    [/#if]
  [/#if]
  [/#list]
  [#else]
    [#if !usb_ll]
      <require Cclass="Device" Cgroup="STM32Cube LL" Csub="USB"/>
      [#assign usb_ll=true]
    [/#if]
  [/#if] 
[#elseif ip?starts_with("CORTEX_M7")]
      <require Cclass="Device" Cgroup="STM32Cube HAL" Csub="Cortex"/>
[#else]
  [#if peripheralParams.get(ip).get("driver") == ("HAL")]
      <require Cclass="Device" Cgroup="STM32Cube HAL" Csub="${(ip)}"/>
  [#else]
      <require Cclass="Device" Cgroup="STM32Cube LL"  Csub="${(ip)}"/>
  [/#if]
[/#if]
[/#if]
[/#list]
    </condition>
  </conditions>
  <components>
    <component generator="STM32CubeMX" Cvendor="Keil" Cclass="Device" Cgroup="STM32Cube Framework" Csub="STM32CubeMX" Cversion="1.1.0" condition="STCubeMX">
      <description>Configuration via STM32CubeMX</description>
      <RTE_Components_h>
        #define RTE_DEVICE_FRAMEWORK_CUBE_MX
      </RTE_Components_h>
      <files>
        <file category="header" name="MX_Device.h"/>
        <file category="header" name="STCubeGenerated/Inc/stm32f4xx_hal_conf.h"/>
        [#if peripheralParams.get("RCC")??]
          [#if peripheralParams.get("RCC").get("driver") == ("HAL")]
        <file category="source" name="STCubeGenerated/Src/stm32f4xx_hal_msp.c"/>
          [/#if]
        [/#if]
      </files>
    </component>
  </components>
</package>
[/#list]
